import request from '@/utils/request'

// 查询维修站订单列表
export function listOrder(query) {
    return request({
        url: '/wxz/order/list',
        method: 'get',
        params: query
    })
}

// 查询维修站订单详细
export function getOrder(id) {
    return request({
        url: '/wxz/order/' + id,
        method: 'get'
    })
}

// 新增维修站订单
export function addOrder(data) {
    return request({
        url: '/wxz/order',
        method: 'post',
        data: data
    })
}

// 修改维修站订单
export function updateOrder(data) {
    return request({
        url: '/wxz/order',
        method: 'put',
        data: data
    })
}

// 删除维修站订单
export function delOrder(id) {
    return request({
        url: '/wxz/order/' + id,
        method: 'delete'
    })
}

// 作废订单
export function invalidateOrder(id) {
    return request({
        url: '/wxz/order/' + id,
        method: 'put'
    })
}

//订单大清除
export const resetSemester = () => {
    request({
        url: '/wxz/order/reset-semester',
        method: 'delete'
    })
}

//修单排行榜
export const getRankingList = () => {
    return request({
        url: '/mobile/order/ranking',
        method: 'get'
    })
}
